package com.ruoyi.business.service;

import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

public interface IProcessService {
    Deployment deploy(String filePath) throws IOException;

    ProcessDefinition selectDefinitionProcessByDeploymentId(String deploymentId);

    InputStream getBpmnInputStream(String deployId);

    InputStream getPngInputStream(String deployId, List<String> highLightedActivities,
                                  List<String> highLightedFlows);

    ProcessInstance startProcessInstance(String definitionKey, String businessKey, Map<String, Object> variables);

    Task getTaskByProcessInstanceId(String id);

    void addCandidateUser(Task currentTask, Long userId);

    InputStream getProcessImgByProcessInstanceId(Long instanceId);

    void deleteProcessInstanceByInstanceId(String instanceId);

    Task getTaskByTaskId(String taskId);

    void claimAndComplete(Task task, String userId, Boolean auditStatus, String comment);

    long selectTodoTaskCount(String userId, String definitionKey);

    List<Task> selectTodoTaskList(String definitionKey, String candidateUser, int firstResult, Integer pageSize);

    ProcessInstance getProcessInstanceById(String processInstanceId);

    void complete(String taskId);

    void claimAndComplete(Task task, Long userId, String comment);

    void setVariable(String taskId, String money, long longValue);

    long getHistoricTaskCount(String definitionKey, String userId);

    List<HistoricTaskInstance> selectHistoricTaskList(String definitionKey, String userId, Integer starNum, Integer pageSize);

    HistoricProcessInstance getHistoricProcessInstanceById(String processInstanceId);

    List<HistoricActivityInstance> selectHistoryTaskList(Long instanceId);

    String getTaskComment(String taskId);
}
